package Q455


import java.util.Arrays
import kotlin.math.sign


/**
 * 分发饼干
 * @author 23737
 * @date 2022.5.11
 */
fun main(){

}

class Solution {
    fun findContentChildren(g: IntArray, s: IntArray): Int {
        Arrays.sort(g)
        Arrays.sort(s)
        val m: Int = g.size
        val n: Int = s.size
        var i = 0
        var j = 0
        while (i < m && j < n) {
            if (g[i] <= s[j]) i++
            j++
        }
        return i
    }
}